package com.smartphonedev.function;

import android.content.Context;
import android.content.SharedPreferences;

import com.smartphonedev.variables.Constants;
public class Storage {


	// Receiver location share
	public static void shareNew(Context context) {

		SharedPreferences settings = context.getSharedPreferences(Constants.foldername, 0);
		SharedPreferences.Editor editor = settings.edit();
		editor.putString(Constants.keynotify, Constants.keyshareok);
		editor.commit();
	}



	public static void clearNotify(Context context) {

		SharedPreferences settings = context.getSharedPreferences(Constants.foldername, 0);
		SharedPreferences.Editor editor = settings.edit();
		editor.putString(Constants.keynotify, Constants.keynotnotify);
		editor.commit();
	}

	// Receiver confirm share
	public static void confirmShare(Context context) {

		SharedPreferences settings = context.getSharedPreferences(Constants.foldername, 0);
		SharedPreferences.Editor editor = settings.edit();
		editor.putString(Constants.keyconfirm, Constants.keyconfirmok);
		editor.commit();
	}



	public static void clearConfirmShare(Context context) {

		SharedPreferences settings = context.getSharedPreferences(Constants.foldername, 0);
		SharedPreferences.Editor editor = settings.edit();
		editor.putString(Constants.keyconfirm, Constants.keyconfirmnotok);
		editor.commit();
	}

	// Receiver request location

	public static void requestNew(Context context) {

		SharedPreferences settings = context.getSharedPreferences(Constants.foldername, 0);
		SharedPreferences.Editor editor = settings.edit();
		editor.putString(Constants.keyrequest, Constants.keyrequestok);
		editor.commit();
	}

	public static void deleteRequest(Context context) {

		SharedPreferences settings = context.getSharedPreferences(Constants.foldername, 0);
		SharedPreferences.Editor editor = settings.edit();
		editor.putString(Constants.keyrequest, Constants.keyrequestnotok);
		editor.commit();
	}

	// Receiver request accept
	public static void requestAccept(Context context) {

		SharedPreferences settings = context.getSharedPreferences(Constants.foldername, 0);
		SharedPreferences.Editor editor = settings.edit();
		editor.putString(Constants.keyrequestaccept, Constants.keyrequestacceptok);
		editor.commit();
	}

	public static void deleteRequestAccept(Context context) {

		SharedPreferences settings = context.getSharedPreferences(Constants.foldername, 0);
		SharedPreferences.Editor editor = settings.edit();
		editor.putString(Constants.keyrequestaccept, Constants.keyrequestacceptnotok);
		editor.commit();
	}

	// Set key tracking
	public static void openKeyTracking(Context context) {

		SharedPreferences settings = context.getSharedPreferences(Constants.foldername, 0);
		SharedPreferences.Editor editor = settings.edit();
		editor.putString(Constants.keytracking, Constants.keytrackingok);
		editor.commit();
	}

	public static void closeKeyTracking(Context context) {

		SharedPreferences settings = context.getSharedPreferences(Constants.foldername, 0);
		SharedPreferences.Editor editor = settings.edit();
		editor.putString(Constants.keytracking, Constants.keytrackingnotok);
		editor.commit();
	}

	// ...
	public static void setKeyname(Context context) {

		SharedPreferences settings = context.getSharedPreferences(Constants.foldername, 0);
		SharedPreferences.Editor editor = settings.edit();
		editor.putString(Constants.keyname, Constants.keynameok);
		editor.commit();
	}


	public static void setLastShare(Context context) {

		SharedPreferences settings = context.getSharedPreferences(Constants.foldername, 0);
		SharedPreferences.Editor editor = settings.edit();
		editor.putString(Constants.keyreceiverlocal, Constants.keyreceiverlocalok);
		editor.commit();
	}
}

